@import "../../../base.less";

@import "./_var.less";

.@{prefix}-radio {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  font-size: @radio-font-size;
  background: @radio-bg-color;

  &:focus {
    outline: 0;
  }

  &--block {
    display: flex;
    padding: @radio-vertical-padding;
  }

  &--right {
    flex-direction: row-reverse;
  }

  &__icon {
    position: relative;
    width: @radio-icon-size;
    height: @radio-icon-size;
    font-size: @radio-icon-size;
    color: @radio-icon-color;
    overflow: hidden;

    &:empty {
      display: none;
    }

    &--left {
      margin-right: 8px;
    }

    &--checked {
      color: @radio-icon-checked-color;
    }

    &--disabled {
      cursor: not-allowed;
      color: @radio-icon-disabled-color;
    }

    &-circle {
      width: 42px;
      height: 42px;
      border: 3px solid @radio-icon-color;
      border-radius: 50%;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%) scale(.5);
      box-sizing: border-box;

      &--disabled {
        background: @radio-icon-disabled-bg-color;
      }
    }

    &-dot {
      width: 42px;
      height: 42px;
      border: 3px solid @radio-icon-checked-color;
      border-radius: 50%;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%) scale(.5);
      box-sizing: border-box;
      display: flex;
      align-items: center;
      justify-content: center;

      &::after {
        content: "";
        display: block;
        width: 24px;
        height: 24px;
        background: @radio-icon-checked-color;
        border-radius: 50%;
      }

      &--disabled {
        border-color: @radio-icon-disabled-color;

        &::after {
          background: @radio-icon-disabled-color;
        }
      }
    }
  }

  &__image {
    line-height: @radio-icon-size;
  }

  &-icon__image {
    height: @radio-icon-size;
    width: @radio-icon-size;
    vertical-align: sub;
  }

  &__content {
    flex: 1;

    &:empty {
      display: none;
    }
  }

  &__title {
    .limit-title-row();

    color: @radio-label-color;
    line-height: @radio-label-line-height;

    &--disabled {
      cursor: not-allowed;
      color: @radio-label-disabled-color;
    }
  }

  &__description {
    .limit-title-row();

    color: @radio-content-color;
    font-size: 14px;
    line-height: @radio-content-line-height;

    &--disabled {
      cursor: not-allowed;
      color: @radio-content-disabled-color;
    }

    &:empty {
      display: none;
    }
  }

  &__title + &__description {
    margin-top: 4px;
  }

  &__border {
    position: absolute;
    bottom: 0;
    height: 1px;
    background: @radio-border-color;
    left: 48px;
    right: 0;
    transform: scaleY(.5);

    &--right {
      left: 16px;
    }
  }

  // mobile vue
  &__original {
    opacity: 0;
    width: 0;
    height: 0;
  }

  &__icon-wrap {
    display: block;
  }
}
